package pta;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextDouble()) {
        	int sum = 0;
            double a = in.nextDouble();
            String str = String.valueOf(a);
            char[]x = str.toCharArray();
            for(int i=0;i<x.length;i++)
            {
            	if(x[i]!='-'&&x[i]!='.')
            	  sum = sum + x[i]-'0';
            }
            System.out.println(sum);
        }
    }
}